package o;

import android.content.res.ColorStateList;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.widget.ImageView;
import androidx.appcompat.widget.AppCompatImageView;
import com.huawei.skinner.annotation.SkinAdapter;
import com.huawei.skinner.annotation.SkinMethod;
import com.huawei.skinner.annotation.SkinMethods;

@SkinMethods({@SkinMethod(attribute = "src", method = "setImageDrawable", type = ImageView.class), @SkinMethod(attribute = "srcCompat", method = "setImageDrawable", type = AppCompatImageView.class)})
public class fpj {
    @SkinAdapter("tint")
    public static void ॱ(ImageView imageView, ColorStateList colorStateList) {
        iz.ˎ(imageView, colorStateList);
        if (VERSION.SDK_INT < 21 && !(imageView instanceof jd)) {
            Drawable drawable = imageView.getDrawable();
            if (drawable != null) {
                Drawable mutate = gg.ʻ(drawable).mutate();
                gg.ॱ(mutate, colorStateList);
                gg.ˋ(mutate, Mode.SRC_IN);
                if (drawable != mutate) {
                    imageView.setImageDrawable(mutate);
                    return;
                }
                return;
            }
            imageView.setColorFilter(colorStateList.getDefaultColor(), Mode.SRC_IN);
        }
    }
}
